#!/usr/bin/python
# -*- coding:utf-8 -*-
__author__ = 'leiyuany'

import ConfigParser
import urllib2
import urllib
from bs4 import BeautifulSoup
import re

BASE_URL = "https://help.aliyun.com"
INDEX_URL = "https://help.aliyun.com/noticelist/9004748.html"

#CONFIG_DATA_FILE = "E:\Project\crawl_test\config"
cf = ConfigParser.SafeConfigParser()
cf.read("E:\Project\crawl_test\config\data.conf")

def get_config_last_data():
    href = cf.get("data","href")
    title = cf.get("data","title")
    articleid = cf.get("data","articleids").strip()
    print articleid
    articleids = []
    articleids = articleid.split(",")

    return href, title, articleids

def set_config_data(href,title,articleids):
    cf.set("data","href",href)
    cf.set("data","title",title)
    cf.set("data","articleids",articleids)
    cf.write(open("data.conf","w"))
